3.6.31 \(\int \frac {\tan ^2(c+d x)}{\sqrt {a+b \tan (c+d x)}} \, dx\) [531]

Optimal. Leaf size=424 \[ -\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a^2+b^2} \sqrt {a-\sqrt {a^2+b^2}} d}+\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a^2+b^2} \sqrt {a-\sqrt {a^2+b^2}} d}+\frac {b \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {2 \sqrt {a+b \tan (c+d x)}}{b d} \]

[Out]

-1/2*b*arctanh(((a+(a^2+b^2)^(1/2))^(1/2)-2^(1/2)*(a+b*tan(d*x+c))^(1/2))/(a-(a^2+b^2)^(1/2))^(1/2))/d*2^(1/2)
/(a^2+b^2)^(1/2)/(a-(a^2+b^2)^(1/2))^(1/2)+1/2*b*arctanh(((a+(a^2+b^2)^(1/2))^(1/2)+2^(1/2)*(a+b*tan(d*x+c))^(
1/2))/(a-(a^2+b^2)^(1/2))^(1/2))/d*2^(1/2)/(a^2+b^2)^(1/2)/(a-(a^2+b^2)^(1/2))^(1/2)+1/4*b*ln(a+(a^2+b^2)^(1/2
)-2^(1/2)*(a+(a^2+b^2)^(1/2))^(1/2)*(a+b*tan(d*x+c))^(1/2)+b*tan(d*x+c))/d*2^(1/2)/(a^2+b^2)^(1/2)/(a+(a^2+b^2
)^(1/2))^(1/2)-1/4*b*ln(a+(a^2+b^2)^(1/2)+2^(1/2)*(a+(a^2+b^2)^(1/2))^(1/2)*(a+b*tan(d*x+c))^(1/2)+b*tan(d*x+c
))/d*2^(1/2)/(a^2+b^2)^(1/2)/(a+(a^2+b^2)^(1/2))^(1/2)+2*(a+b*tan(d*x+c))^(1/2)/b/d

________________________________________________________________________________________

Rubi [A]
time = 0.28, antiderivative size = 424, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 8, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3624, 3566, 722, 1108, 648, 632, 212, 642} \begin {gather*} \frac {b \log \left (-\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \tan (c+d x)}+\sqrt {a^2+b^2}+a+b \tan (c+d x)\right )}{2 \sqrt {2} d \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}-\frac {b \log \left (\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \tan (c+d x)}+\sqrt {a^2+b^2}+a+b \tan (c+d x)\right )}{2 \sqrt {2} d \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}-\frac {b \tanh ^{-1}\left (\frac {\sqrt {\sqrt {a^2+b^2}+a}-\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} d \sqrt {a^2+b^2} \sqrt {a-\sqrt {a^2+b^2}}}+\frac {b \tanh ^{-1}\left (\frac {\sqrt {\sqrt {a^2+b^2}+a}+\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} d \sqrt {a^2+b^2} \sqrt {a-\sqrt {a^2+b^2}}}+\frac {2 \sqrt {a+b \tan (c+d x)}}{b d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/Sqrt[a + b*Tan[c + d*x]],x]

[Out]

-((b*ArcTanh[(Sqrt[a + Sqrt[a^2 + b^2]] - Sqrt[2]*Sqrt[a + b*Tan[c + d*x]])/Sqrt[a - Sqrt[a^2 + b^2]]])/(Sqrt[
2]*Sqrt[a^2 + b^2]*Sqrt[a - Sqrt[a^2 + b^2]]*d)) + (b*ArcTanh[(Sqrt[a + Sqrt[a^2 + b^2]] + Sqrt[2]*Sqrt[a + b*
Tan[c + d*x]])/Sqrt[a - Sqrt[a^2 + b^2]]])/(Sqrt[2]*Sqrt[a^2 + b^2]*Sqrt[a - Sqrt[a^2 + b^2]]*d) + (b*Log[a +
Sqrt[a^2 + b^2] + b*Tan[c + d*x] - Sqrt[2]*Sqrt[a + Sqrt[a^2 + b^2]]*Sqrt[a + b*Tan[c + d*x]]])/(2*Sqrt[2]*Sqr
t[a^2 + b^2]*Sqrt[a + Sqrt[a^2 + b^2]]*d) - (b*Log[a + Sqrt[a^2 + b^2] + b*Tan[c + d*x] + Sqrt[2]*Sqrt[a + Sqr
t[a^2 + b^2]]*Sqrt[a + b*Tan[c + d*x]]])/(2*Sqrt[2]*Sqrt[a^2 + b^2]*Sqrt[a + Sqrt[a^2 + b^2]]*d) + (2*Sqrt[a +
 b*Tan[c + d*x]])/(b*d)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 722

Int[1/(Sqrt[(d_) + (e_.)*(x_)]*((a_) + (c_.)*(x_)^2)), x_Symbol] :> Dist[2*e, Subst[Int[1/(c*d^2 + a*e^2 - 2*c
*d*x^2 + c*x^4), x], x, Sqrt[d + e*x]], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0]

Rule 1108

Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(-1), x_Symbol] :> With[{q = Rt[a/c, 2]}, With[{r = Rt[2*q - b/c, 2]}
, Dist[1/(2*c*q*r), Int[(r - x)/(q - r*x + x^2), x], x] + Dist[1/(2*c*q*r), Int[(r + x)/(q + r*x + x^2), x], x
]]] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && NegQ[b^2 - 4*a*c]

Rule 3566

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[(a + x)^n/(b^2 + x^2), x], x
, b*Tan[c + d*x]], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[a^2 + b^2, 0]

Rule 3624

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[
d^2*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f*x])^m*Simp[c^2 - d^2 + 2*c*d*Tan[e
 + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] &&  !LeQ[m, -1] &&  !(EqQ[m, 2] && EqQ
[a, 0])

Rubi steps

\begin {align*} \int \frac {\tan ^2(c+d x)}{\sqrt {a+b \tan (c+d x)}} \, dx &=\frac {2 \sqrt {a+b \tan (c+d x)}}{b d}-\int \frac {1}{\sqrt {a+b \tan (c+d x)}} \, dx\\ &=\frac {2 \sqrt {a+b \tan (c+d x)}}{b d}-\frac {b \text {Subst}\left (\int \frac {1}{\sqrt {a+x} \left (b^2+x^2\right )} \, dx,x,b \tan (c+d x)\right )}{d}\\ &=\frac {2 \sqrt {a+b \tan (c+d x)}}{b d}-\frac {(2 b) \text {Subst}\left (\int \frac {1}{a^2+b^2-2 a x^2+x^4} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{d}\\ &=\frac {2 \sqrt {a+b \tan (c+d x)}}{b d}-\frac {b \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}-x}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{\sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+x}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{\sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}\\ &=\frac {2 \sqrt {a+b \tan (c+d x)}}{b d}-\frac {b \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {a^2+b^2} d}-\frac {b \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {a^2+b^2} d}+\frac {b \text {Subst}\left (\int \frac {-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 x}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 x}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}\\ &=\frac {b \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {2 \sqrt {a+b \tan (c+d x)}}{b d}+\frac {b \text {Subst}\left (\int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-x^2} \, dx,x,-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 \sqrt {a+b \tan (c+d x)}\right )}{\sqrt {a^2+b^2} d}+\frac {b \text {Subst}\left (\int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-x^2} \, dx,x,\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 \sqrt {a+b \tan (c+d x)}\right )}{\sqrt {a^2+b^2} d}\\ &=-\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a^2+b^2} \sqrt {a-\sqrt {a^2+b^2}} d}+\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a^2+b^2} \sqrt {a-\sqrt {a^2+b^2}} d}+\frac {b \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {2 \sqrt {a+b \tan (c+d x)}}{b d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.21, size = 108, normalized size = 0.25 \begin {gather*} \frac {\frac {i \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{\sqrt {a-i b}}-\frac {i \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{\sqrt {a+i b}}+\frac {2 \sqrt {a+b \tan (c+d x)}}{b}}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^2/Sqrt[a + b*Tan[c + d*x]],x]

[Out]

((I*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a - I*b]])/Sqrt[a - I*b] - (I*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[
a + I*b]])/Sqrt[a + I*b] + (2*Sqrt[a + b*Tan[c + d*x]])/b)/d

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(796\) vs. \(2(343)=686\).
time = 0.14, size = 797, normalized size = 1.88

method result size
derivativedivides \(\frac {2 \sqrt {a +b \tan \left (d x +c \right )}-2 b^{2} \left (\frac {\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (2 a^{2} b^{2}+2 b^{4}-\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}+\frac {-\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \ln \left (-b \tan \left (d x +c \right )-a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-2 a^{2} b^{2}-2 b^{4}+\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {-2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{b d}\) \(797\)
default \(\frac {2 \sqrt {a +b \tan \left (d x +c \right )}-2 b^{2} \left (\frac {\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (2 a^{2} b^{2}+2 b^{4}-\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}+\frac {-\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \ln \left (-b \tan \left (d x +c \right )-a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-2 a^{2} b^{2}-2 b^{4}+\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {-2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{b d}\) \(797\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^2/(a+b*tan(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

2/d/b*((a+b*tan(d*x+c))^(1/2)-b^2*(1/4/b^2/(a^2+b^2)^(3/2)*(1/2*((2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)
*a^2+(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*b^2-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a^3-(2*(a^2+b^2)^(1/2)+2*
a)^(1/2)*a*b^2)*ln(b*tan(d*x+c)+a+(a+b*tan(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1/2))+2*(2*a
^2*b^2+2*b^4-1/2*((2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*a^2+(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1
/2)*b^2-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a^3-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a*b^2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/
(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((2*(a+b*tan(d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/
2)-2*a)^(1/2)))+1/4/b^2/(a^2+b^2)^(3/2)*(-1/2*((2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*a^2+(2*(a^2+b^2)^
(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*b^2-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a^3-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a*b^2)*ln
(-b*tan(d*x+c)-a+(a+b*tan(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)-(a^2+b^2)^(1/2))+2*(-2*a^2*b^2-2*b^4+1/2
*((2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*a^2+(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*b^2-(2*(a^2+
b^2)^(1/2)+2*a)^(1/2)*a^3-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a*b^2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/
2)-2*a)^(1/2)*arctan((-2*(a+b*tan(d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)))
))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+b*tan(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

integrate(tan(d*x + c)^2/sqrt(b*tan(d*x + c) + a), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1774 vs. \(2 (345) = 690\).
time = 0.88, size = 1774, normalized size = 4.18 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+b*tan(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

1/4*(4*sqrt(2)*(a^2*b + b^3)*d^5*sqrt(((a^3 + a*b^2)*d^2*sqrt(1/((a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*sqrt(b^2/
((a^4 + 2*a^2*b^2 + b^4)*d^4))*(1/((a^2 + b^2)*d^4))^(3/4)*arctan((sqrt(2)*(a^4 + 2*a^2*b^2 + b^4)*d^7*sqrt((s
qrt(2)*b^3*d*sqrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))*sqrt(((a^3 + a*b^2)*d^2*sqrt(1/((a^2 + b^2)*
d^4)) + a^2 + b^2)/b^2)*(1/((a^2 + b^2)*d^4))^(1/4)*cos(d*x + c) + (a^2*b^2 + b^4)*d^2*sqrt(1/((a^2 + b^2)*d^4
))*cos(d*x + c) + a*b^2*cos(d*x + c) + b^3*sin(d*x + c))/cos(d*x + c))*sqrt(((a^3 + a*b^2)*d^2*sqrt(1/((a^2 +
b^2)*d^4)) + a^2 + b^2)/b^2)*sqrt(b^2/((a^4 + 2*a^2*b^2 + b^4)*d^4))*(1/((a^2 + b^2)*d^4))^(5/4) - sqrt(2)*(a^
4*b + 2*a^2*b^3 + b^5)*d^7*sqrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))*sqrt(((a^3 + a*b^2)*d^2*sqrt(1
/((a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*sqrt(b^2/((a^4 + 2*a^2*b^2 + b^4)*d^4))*(1/((a^2 + b^2)*d^4))^(5/4) - (a
^4 + 2*a^2*b^2 + b^4)*d^4*sqrt(b^2/((a^4 + 2*a^2*b^2 + b^4)*d^4))*sqrt(1/((a^2 + b^2)*d^4)) - (a^3 + a*b^2)*d^
2*sqrt(b^2/((a^4 + 2*a^2*b^2 + b^4)*d^4)))/b^2) + 4*sqrt(2)*(a^2*b + b^3)*d^5*sqrt(((a^3 + a*b^2)*d^2*sqrt(1/(
(a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*sqrt(b^2/((a^4 + 2*a^2*b^2 + b^4)*d^4))*(1/((a^2 + b^2)*d^4))^(3/4)*arctan
((sqrt(2)*(a^4 + 2*a^2*b^2 + b^4)*d^7*sqrt(-(sqrt(2)*b^3*d*sqrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c)
)*sqrt(((a^3 + a*b^2)*d^2*sqrt(1/((a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*(1/((a^2 + b^2)*d^4))^(1/4)*cos(d*x + c)
 - (a^2*b^2 + b^4)*d^2*sqrt(1/((a^2 + b^2)*d^4))*cos(d*x + c) - a*b^2*cos(d*x + c) - b^3*sin(d*x + c))/cos(d*x
 + c))*sqrt(((a^3 + a*b^2)*d^2*sqrt(1/((a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*sqrt(b^2/((a^4 + 2*a^2*b^2 + b^4)*d
^4))*(1/((a^2 + b^2)*d^4))^(5/4) - sqrt(2)*(a^4*b + 2*a^2*b^3 + b^5)*d^7*sqrt((a*cos(d*x + c) + b*sin(d*x + c)
)/cos(d*x + c))*sqrt(((a^3 + a*b^2)*d^2*sqrt(1/((a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*sqrt(b^2/((a^4 + 2*a^2*b^2
 + b^4)*d^4))*(1/((a^2 + b^2)*d^4))^(5/4) + (a^4 + 2*a^2*b^2 + b^4)*d^4*sqrt(b^2/((a^4 + 2*a^2*b^2 + b^4)*d^4)
)*sqrt(1/((a^2 + b^2)*d^4)) + (a^3 + a*b^2)*d^2*sqrt(b^2/((a^4 + 2*a^2*b^2 + b^4)*d^4)))/b^2) + sqrt(2)*(a*b*d
^3*sqrt(1/((a^2 + b^2)*d^4)) - b*d)*sqrt(((a^3 + a*b^2)*d^2*sqrt(1/((a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*(1/((a
^2 + b^2)*d^4))^(1/4)*log((sqrt(2)*b^3*d*sqrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))*sqrt(((a^3 + a*b
^2)*d^2*sqrt(1/((a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*(1/((a^2 + b^2)*d^4))^(1/4)*cos(d*x + c) + (a^2*b^2 + b^4)
*d^2*sqrt(1/((a^2 + b^2)*d^4))*cos(d*x + c) + a*b^2*cos(d*x + c) + b^3*sin(d*x + c))/cos(d*x + c)) - sqrt(2)*(
a*b*d^3*sqrt(1/((a^2 + b^2)*d^4)) - b*d)*sqrt(((a^3 + a*b^2)*d^2*sqrt(1/((a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*(
1/((a^2 + b^2)*d^4))^(1/4)*log(-(sqrt(2)*b^3*d*sqrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))*sqrt(((a^3
 + a*b^2)*d^2*sqrt(1/((a^2 + b^2)*d^4)) + a^2 + b^2)/b^2)*(1/((a^2 + b^2)*d^4))^(1/4)*cos(d*x + c) - (a^2*b^2
+ b^4)*d^2*sqrt(1/((a^2 + b^2)*d^4))*cos(d*x + c) - a*b^2*cos(d*x + c) - b^3*sin(d*x + c))/cos(d*x + c)) + 8*s
qrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c)))/(b*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{2}{\left (c + d x \right )}}{\sqrt {a + b \tan {\left (c + d x \right )}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**2/(a+b*tan(d*x+c))**(1/2),x)

[Out]

Integral(tan(c + d*x)**2/sqrt(a + b*tan(c + d*x)), x)

________________________________________________________________________________________

Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+b*tan(d*x+c))^(1/2),x, algorithm="giac")

[Out]

Timed out

________________________________________________________________________________________

Mupad [B]
time = 4.86, size = 730, normalized size = 1.72 \begin {gather*} \frac {\ln \left (-16\,b^2\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}+16\,b^3\,d\,\sqrt {-\frac {1}{d^2\,\left (a-b\,1{}\mathrm {i}\right )}}+\frac {16\,a\,b^2\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{a-b\,1{}\mathrm {i}}\right )\,\sqrt {-\frac {1}{a\,d^2-b\,d^2\,1{}\mathrm {i}}}}{2}-\ln \left (16\,b^2\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}+16\,b^3\,d\,\sqrt {-\frac {1}{d^2\,\left (a-b\,1{}\mathrm {i}\right )}}-\frac {16\,a\,b^2\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{a-b\,1{}\mathrm {i}}\right )\,\sqrt {-\frac {1}{4\,\left (a\,d^2-b\,d^2\,1{}\mathrm {i}\right )}}+\frac {2\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{b\,d}-\mathrm {atan}\left (-\frac {b^2\,\sqrt {-\frac {a}{4\,a^2\,d^2+4\,b^2\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}\,32{}\mathrm {i}}{-\frac {64\,a\,b^3\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {b^4\,d^2\,64{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}}+\frac {128\,a\,b^3\,\sqrt {-\frac {a}{4\,a^2\,d^2+4\,b^2\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{-\frac {256\,a^3\,b^3\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}-\frac {256\,a\,b^5\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {b^6\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {a^2\,b^4\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}}+\frac {a^2\,b^2\,\sqrt {-\frac {a}{4\,a^2\,d^2+4\,b^2\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}\,128{}\mathrm {i}}{-\frac {256\,a^3\,b^3\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}-\frac {256\,a\,b^5\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {b^6\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {a^2\,b^4\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}}\right )\,\sqrt {-\frac {a-b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}\,2{}\mathrm {i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^2/(a + b*tan(c + d*x))^(1/2),x)

[Out]

(log(16*b^3*d*(-1/(d^2*(a - b*1i)))^(1/2) - 16*b^2*(a + b*tan(c + d*x))^(1/2) + (16*a*b^2*(a + b*tan(c + d*x))
^(1/2))/(a - b*1i))*(-1/(a*d^2 - b*d^2*1i))^(1/2))/2 - log(16*b^2*(a + b*tan(c + d*x))^(1/2) + 16*b^3*d*(-1/(d
^2*(a - b*1i)))^(1/2) - (16*a*b^2*(a + b*tan(c + d*x))^(1/2))/(a - b*1i))*(-1/(4*(a*d^2 - b*d^2*1i)))^(1/2) -
atan((128*a*b^3*((b*1i)/(4*a^2*d^2 + 4*b^2*d^2) - a/(4*a^2*d^2 + 4*b^2*d^2))^(1/2)*(a + b*tan(c + d*x))^(1/2))
/((b^6*d^2*256i)/(4*a^2*d^3 + 4*b^2*d^3) + (a^2*b^4*d^2*256i)/(4*a^2*d^3 + 4*b^2*d^3) - (256*a^3*b^3*d^2)/(4*a
^2*d^3 + 4*b^2*d^3) - (256*a*b^5*d^2)/(4*a^2*d^3 + 4*b^2*d^3)) - (b^2*((b*1i)/(4*a^2*d^2 + 4*b^2*d^2) - a/(4*a
^2*d^2 + 4*b^2*d^2))^(1/2)*(a + b*tan(c + d*x))^(1/2)*32i)/((b^4*d^2*64i)/(4*a^2*d^3 + 4*b^2*d^3) - (64*a*b^3*
d^2)/(4*a^2*d^3 + 4*b^2*d^3)) + (a^2*b^2*((b*1i)/(4*a^2*d^2 + 4*b^2*d^2) - a/(4*a^2*d^2 + 4*b^2*d^2))^(1/2)*(a
 + b*tan(c + d*x))^(1/2)*128i)/((b^6*d^2*256i)/(4*a^2*d^3 + 4*b^2*d^3) + (a^2*b^4*d^2*256i)/(4*a^2*d^3 + 4*b^2
*d^3) - (256*a^3*b^3*d^2)/(4*a^2*d^3 + 4*b^2*d^3) - (256*a*b^5*d^2)/(4*a^2*d^3 + 4*b^2*d^3)))*(-(a - b*1i)/(4*
a^2*d^2 + 4*b^2*d^2))^(1/2)*2i + (2*(a + b*tan(c + d*x))^(1/2))/(b*d)

________________________________________________________________________________________